package com.cty._01_Base._02_Singleton;

/**
 * @Auther: cty
 * @Date: 2020/6/25 8:50
 * @Description: 懒汉式实现单例模式
 * @version: 1.0
 */
public class Singleton02 {
    private static Singleton02 instance;

    private Singleton02(){
    }

    public static synchronized Singleton02 getInstance(){
        if(instance == null)  // 空判断
            instance = new Singleton02();
        return instance;
    }

}  // end Singleton02{}
